package com.zmh.service.timer;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

import com.zmh.service.wechat.MessageInfoService;

/** 
 * 消息发送定时器
 * @author zhoumh
 * @version 创建时间：2018年6月18日 下午5:18:03 
 * @Description 
*/
@Service
@EnableScheduling
public class SendMessageTimer {
	private static Logger logger = LoggerFactory.getLogger(SendMessageTimer.class);
	@Autowired
	private MessageInfoService messageInfoService;
	/**
	 * 监控消息列表发送未发送的消息
	 * @return: void
	 * @author: zhoumh
	 * @version: 创建时间：2017年11月5日 下午3:30:29 
	 * @Description:
	 */
	@Scheduled(cron = "0 0/1 * * * ?")
	public void sendMessage() {
		logger.info("开始发送消息");
		messageInfoService.sendMessageByEmail();
	}
}
